<template>
  <div class="nuxt-container">
    <!-- 默认布局组件 -->
    <Nuxt />
    <el-backtop :bottom="100" :right="20"></el-backtop>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
import en from 'element-ui/lib/locale/lang/en'
import zh from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'
export default {
  name: 'DefaultLayout',
  computed: {
    ...mapGetters(["token", "avatar", "name"]),
  },
  mounted() {
    //elementui国际化
    let lang = this.$i18n.locale == 'en'? en :zh
    locale.use(lang)
  },
  watch: {
    $route(){
      //elementui国际化
      let lang = this.$i18n.locale == 'en'? en :zh
      locale.use(lang)
    }
  }
};
</script>
<style>
.nuxt-container {
  height: 100vh;
  min-height: 100vh;
  /* overflow-y: auto; */
}
</style>